export const basic = {
  mainDataGrid: {
    // 表格配置项
    columns: [
      { prop: "operation", label: "operation", fixed: "left", width: 270 },
      {
        prop: "workerFlag",
        label: "工单标识"
      },
      {
        prop: "customerName",
        label: "客户简称"
      },
      {
        prop: "line",
        label: "线体",
        enum: () => "function@getDictionaryListByCodes('soLine')",
        search: {
          el: "select",
          order: 5
        }
      },
      {
        prop: "workerCode",
        label: "工单号"
      },
      {
        prop: "planStart",
        label: "计划开始时间",
        width: 120
      },
      {
        prop: "planEnd",
        label: "计划结束时间",
        width: 120
      },
      {
        prop: "doStarttime",
        label: "实际开始时间",
        width: 140
      },
      {
        prop: "doEndtime",
        label: "实际结束时间",
        width: 140
      },
      {
        prop: "flagMerge",
        label: "报工类型",
        width: 100,
        enum: [
          { label: "不合并报工", value: 0, tagType: "success" },
          { label: "合并报工", value: 1, tagType: "warning" }
        ],
        tag: true
      },
      {
        prop: "_doAlong",
        label: "实际耗时(小时)",
        width: 120
      },
      {
        prop: "status",
        label: "状态",
        tag: true,
        width: 90,
        enum: [
          { label: "待开始分拣", value: 10, tagType: "warning" },
          { label: "分拣中", value: 20, tagType: "warning" },
          { label: "完成分拣", value: 30, tagType: "success" }
        ],
        search: {
          el: "select"
        }
      },
      {
        prop: "remark",
        label: "备注"
      }
    ],
    headButtonList: [],
    requestApi: "api@post@/nmes/workerSo/page",
    rowButtonList: [
      {
        label: "changePassword",
        type: "primary",
        methods: `function@(a, b)=> {return a + b + bb; }`,
        attrs: {
          link: true
        }
      },
      {
        label: "enable",
        type: "primary",
        hide: "function@(item) => item.flagMerge === 0",
        methods: ``,
        attrs: {
          link: true
        }
      }
    ]
  },
  bottomDataGrid: [
    {
      title: "来料明细",
      key: "default",
      requestAuto: false,
      pagination: false,
      showSummary: true,
      requestApi: "api@get@/nmes/workerSo/item?",
      initParam: {
        id: -1
      },
      // eval("v[1]")
      getSummary: "function@({ data }) =>['合计', null, summationArr(data, 'grossWeight')]",
      dataCallback: `function@(data) => {
        const setFlagList = (item) => {
          const { flagSoConfirm, flagSplitConfirm } = item || {};
          const arr = [];
          if (flagSoConfirm == 1) {
            arr.push("分拣");
          }
          if (flagSplitConfirm == 1) {
            arr.push("拆解");
          }
          return arr;
        };
        data = data.map(item => {
          return {
            ...item,
            flagList: setFlagList(item)
          };
        });
        return data;
      }`,
      // 表格配置项
      columns: [
        {
          prop: "materialInfo",
          label: "物料名称"
        },

        {
          prop: "packageType",
          label: "容器类型"
        },
        {
          prop: "grossWeight",
          label: "净重"
        },
        {
          prop: "packageNum",
          label: "包装编号"
        },
        {
          prop: "flagList",
          label: "分拣标识",
          width: 115
        },
        {
          prop: "receiveCode",
          label: "来料单"
        },
        {
          prop: "dotime",
          label: "操作时间"
        },
        {
          prop: "remark",
          label: "备注"
        }
      ],
      headButtonList: [],
      rowButtonList: []
    }
  ]
};
